package day6;

import java.util.Calendar;
import java.util.Date;

/**
 * @author oldliu
 * @since 1.0
 */
public class CalTest {
    public static void main(String[] args) {
        Calendar c=Calendar.getInstance();
        System.out.println(c);
        Date time = c.getTime();
        System.out.println("Date:"+time);
        long mi = c.getTimeInMillis();
        System.out.println("毫秒："+mi);
        //获得日期的各个部分
        System.out.println("年："+c.get(Calendar.YEAR));
        System.out.println("月："+c.get(Calendar.MONTH));
        System.out.println("这一年的第几天："+c.get(Calendar.DAY_OF_YEAR));
        System.out.println("周几："+c.get(Calendar.DAY_OF_WEEK));
        //每周的开头是周日还是周一，可以设置的
        //add
        //roll
        
    }
}
